package org.dfzt.modules.online.cgform.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.shiro.SecurityUtils;
import org.dfzt.common.system.vo.LoginUser;
import org.dfzt.common.util.oConvertUtils;
import org.dfzt.modules.online.cgform.link.LinkDown;
import org.dfzt.modules.online.cgform.entity.OnlCgformField;
import org.dfzt.modules.online.cgform.entity.OnlCgformHead;
import org.dfzt.modules.online.cgform.mapper.OnlCgformFieldMapper;
import org.dfzt.modules.online.cgform.mapper.OnlCgformHeadMapper;
import org.dfzt.modules.online.cgform.model.TreeModel;
import org.dfzt.modules.online.cgform.service.IOnlCgformFieldService;
import org.dfzt.modules.online.cgform.util.b;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("onlCgformFieldServiceImpl")
public class OnlCgformFieldServiceImpl
        extends ServiceImpl<OnlCgformFieldMapper, OnlCgformField>
        implements IOnlCgformFieldService {
    private static final Logger a = LoggerFactory.getLogger(OnlCgformFieldServiceImpl.class);


    @Autowired
    private OnlCgformFieldMapper onlCgformFieldMapper;


    @Autowired
    private OnlCgformHeadMapper cgformHeadMapper;

//  private static final String b = "0";

    @Override
    public Map<String, Object> queryAutolistPage(String tbname, String headId, Map<String, Object> params, List<String> needList) {
        HashMap hashMap = new HashMap();


        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, headId);
        lambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
        List list1 = list(lambdaQueryWrapper);


        List list2 = queryAvailableFields(tbname, true, list1, needList);


        StringBuffer stringBuffer = new StringBuffer();

        b.a(tbname, list2, stringBuffer);

        String str1 = b.a(list1, params, needList);


        String str2 = b.a(params);

        stringBuffer.append(" where 1=1  " + str1 + str2);


        Object object = params.get("column");
        if (object != null) {
            String str3 = object.toString();
            String str4 = params.get("order").toString();
            if (a(str3, list1)) {
                stringBuffer.append(" ORDER BY " + oConvertUtils.camelToUnderline(str3));
                if ("asc".equals(str4)) {
                    stringBuffer.append(" asc");
                } else {
                    stringBuffer.append(" desc");
                }
            }
        }

        Integer integer = Integer.valueOf((params.get("pageSize") == null) ? 10 : Integer.parseInt(params.get("pageSize").toString()));
        if (integer.intValue() == -521) {

            List list = this.onlCgformFieldMapper.queryListBySql(stringBuffer.toString());
            a.info("---Online查询sql 不分页 :>>" + stringBuffer.toString());
            if (list == null || list.size() == 0) {
                hashMap.put("total", Integer.valueOf(0));
                hashMap.put("fieldList", list2);
            } else {
                hashMap.put("total", Integer.valueOf(list.size()));
                hashMap.put("fieldList", list2);
                hashMap.put("records", b.d(list));
            }
        } else {
            Integer integer1 = Integer.valueOf((params.get("pageNo") == null) ? 1 : Integer.parseInt(params.get("pageNo").toString()));
            Page page = new Page(integer1.intValue(), integer.intValue());
            a.info("---Online查询sql:>>" + stringBuffer.toString());
            IPage iPage = this.onlCgformFieldMapper.selectPageBySql(page, stringBuffer.toString());


            hashMap.put("total", Long.valueOf(iPage.getTotal()));
            hashMap.put("records", b.d(iPage.getRecords()));
        }
        return hashMap;
    }


    @Override
    public void saveFormData(String code, String tbname, JSONObject json, boolean isCrazy) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        List list = list(lambdaQueryWrapper);
        if (isCrazy) {
            ((OnlCgformFieldMapper) this.baseMapper).executeInsertSQL(b.c(tbname, list, json));
        } else {
            ((OnlCgformFieldMapper) this.baseMapper).executeInsertSQL(b.a(tbname, list, json));
        }
    }

    @Override
    public void saveTreeFormData(String code, String tbname, JSONObject json, String hasChildField, String pidField) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        List<OnlCgformField> list = list(lambdaQueryWrapper);
        for (OnlCgformField onlCgformField : list) {

            if (hasChildField.equals(onlCgformField.getDbFieldName()) && onlCgformField.getIsShowForm().intValue() != 1) {
                onlCgformField.setIsShowForm(Integer.valueOf(1));
                json.put(hasChildField, "0");

                continue;
            }
            if (pidField.equals(onlCgformField.getDbFieldName()) && oConvertUtils.isEmpty(json.get(pidField))) {
                onlCgformField.setIsShowForm(Integer.valueOf(1));
                json.put(pidField, "0");
            }
        }
        Map map = b.a(tbname, list, json);
        ((OnlCgformFieldMapper) this.baseMapper).executeInsertSQL(map);

        if (!"0".equals(json.getString(pidField))) {
            ((OnlCgformFieldMapper) this.baseMapper).editFormData("update " + tbname + " set " + hasChildField + " = '1' where id = '" + json.getString(pidField) + "'");
        }
    }


    @Override
    public void saveFormData(List<OnlCgformField> fieldList, String tbname, JSONObject json) {
        Map map = b.a(tbname, fieldList, json);
        ((OnlCgformFieldMapper) this.baseMapper).executeInsertSQL(map);
    }


    @Override
    public void editFormData(String code, String tbname, JSONObject json, boolean isCrazy) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        List list = list(lambdaQueryWrapper);
        if (isCrazy) {
            ((OnlCgformFieldMapper) this.baseMapper).executeUpdatetSQL(b.d(tbname, list, json));
        } else {
            ((OnlCgformFieldMapper) this.baseMapper).executeUpdatetSQL(b.b(tbname, list, json));
        }
    }


    @Override
    public void editTreeFormData(String code, String tbname, JSONObject json, String hasChildField, String pidField) {
        String str1 = b.f(tbname);
        String str2 = "select * from " + str1 + " where id = '" + json.getString("id") + "'";
        Map map1 = ((OnlCgformFieldMapper) this.baseMapper).queryFormData(str2);

        Map map2 = b.b(map1);
        String str3 = map2.get(pidField).toString();


        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        List<OnlCgformField> list = list(lambdaQueryWrapper);
        for (OnlCgformField onlCgformField : list) {

            if (pidField.equals(onlCgformField.getDbFieldName()) && oConvertUtils.isEmpty(json.get(pidField))) {
                onlCgformField.setIsShowForm(1);
                json.put(pidField, "0");
            }
        }
        Map map3 = b.b(tbname, list, json);

        ((OnlCgformFieldMapper) this.baseMapper).executeUpdatetSQL(map3);

        if (!str3.equals(json.getString(pidField))) {

            if (!"0".equals(str3)) {
                String str = "select count(*) from " + str1 + " where " + pidField + " = '" + str3 + "'";
                Integer integer = ((OnlCgformFieldMapper) this.baseMapper).queryCountBySql(str);
                if (integer == null || integer.intValue() == 0) {
                    ((OnlCgformFieldMapper) this.baseMapper).editFormData("update " + str1 + " set " + hasChildField + " = '0' where id = '" + str3 + "'");
                }
            }

            if (!"0".equals(json.getString(pidField))) {
                ((OnlCgformFieldMapper) this.baseMapper).editFormData("update " + str1 + " set " + hasChildField + " = '1' where id = '" + json.getString(pidField) + "'");
            }
        }
    }


    @Override
    public Map<String, Object> queryFormData(String code, String tbname, String id) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        lambdaQueryWrapper.eq(OnlCgformField::getIsShowForm, Integer.valueOf(1));
        List list = list(lambdaQueryWrapper);
        String str = b.a(tbname, list, id);
        return this.onlCgformFieldMapper.queryFormData(str);
    }


    @Override
    @Transactional(rollbackFor = {Exception.class})
    public void deleteAutoListMainAndSub(OnlCgformHead head, String ids) {
        if (head.getTableType().intValue() == 2) {
            String str1 = head.getId();
            String str2 = head.getTableName();

            String str3 = "tableName";
            String str4 = "linkField";
            String str5 = "linkValueStr";
            String str6 = "mainField";

            ArrayList<Map> arrayList = new ArrayList();

            if (oConvertUtils.isNotEmpty(head.getSubTableStr())) {
                for (String str : head.getSubTableStr().split(",")) {

                    OnlCgformHead onlCgformHead = (OnlCgformHead) this.cgformHeadMapper.selectOne((Wrapper) (new LambdaQueryWrapper<OnlCgformHead>()).eq(OnlCgformHead::getTableName, str));
                    if (onlCgformHead != null) {

                        LambdaQueryWrapper<OnlCgformField> eq = (new LambdaQueryWrapper<OnlCgformField>()).eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId());
                        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper1 = (eq).eq(OnlCgformField::getMainTable, head.getTableName());
                        List list1 = list(lambdaQueryWrapper1);
                        if (list1 != null && list1.size() != 0) {


                            OnlCgformField onlCgformField = (OnlCgformField) list1.get(0);
                            HashMap hashMap = new HashMap();

                            hashMap.put(str4, onlCgformField.getDbFieldName());

                            hashMap.put(str6, onlCgformField.getMainField());

                            hashMap.put(str3, str);
                            hashMap.put(str5, "");
                            arrayList.add(hashMap);
                        }
                    }
                }
                LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
                lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, str1);

                List list = list(lambdaQueryWrapper);

                String[] arrayOfString = ids.split(",");

                for (String str7 : arrayOfString) {
                    String str8 = b.a(str2, list, str7);

                    Map map = this.onlCgformFieldMapper.queryFormData(str8);
                    ArrayList arrayList1 = new ArrayList();
                    for (Map map1 : arrayList) {
                        Object object = map.get(((String) map1.get(str6)).toLowerCase());
                        if (object == null) {
                            object = map.get(((String) map1.get(str6)).toUpperCase());
                        }
                        if (object == null) {
                            continue;
                        }
                        String str = (String) map1.get(str5) + String.valueOf(object) + ",";
                        map1.put(str5, str);
                    }
                }

                for (Map map : arrayList) {
                    deleteAutoList((String) map.get(str3), (String) map.get(str4), (String) map.get(str5));
                }
            }

            deleteAutoListById(head.getTableName(), ids);
        }
    }


    @Override
    public void deleteAutoListById(String tbname, String ids) {
        deleteAutoList(tbname, "id", ids);
    }


    @Override
    public void deleteAutoList(String tbname, String linkField, String linkValue) {
        if (linkValue != null && !"".equals(linkValue)) {
            String[] arrayOfString = linkValue.split(",");
            StringBuffer stringBuffer = new StringBuffer();
            for (String str : arrayOfString) {
                if (str != null && !"".equals(str)) {

                    stringBuffer.append("'" + str + "',");
                }
            }
            String str1 = stringBuffer.toString();
            String str2 = "DELETE FROM " + b.f(tbname) + " where " + linkField + " in(" + str1.substring(0, str1.length() - 1) + ")";
            a.info("--删除sql-->" + str2);
            this.onlCgformFieldMapper.deleteAutoList(str2);
        }
    }


    @Override
    public List<Map<String, String>> getAutoListQueryInfo(String code) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        lambdaQueryWrapper.eq(OnlCgformField::getIsQuery, 1);
        lambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
        List<OnlCgformField> list = list(lambdaQueryWrapper);
        ArrayList<Map<String,String>> arrayList = new ArrayList<>();
        byte b1 = 0;
        for (OnlCgformField onlCgformField : list) {
            HashMap<String,String> hashMap = new HashMap<>();
            hashMap.put("label", onlCgformField.getDbFieldTxt());
            hashMap.put("field", onlCgformField.getDbFieldName());
            hashMap.put("mode", onlCgformField.getQueryMode());
            if ("1".equals(onlCgformField.getQueryConfigFlag())) {

                hashMap.put("config", "1");
                hashMap.put("view", onlCgformField.getQueryShowType());
                hashMap.put("defValue", onlCgformField.getQueryDefVal());
                if ("cat_tree".equals(onlCgformField.getFieldShowType())) {
                    hashMap.put("pcode", onlCgformField.getQueryDictField());
                } else if ("sel_tree".equals(onlCgformField.getFieldShowType())) {

                    String[] arrayOfString = onlCgformField.getQueryDictText().split(",");
                    String str = onlCgformField.getQueryDictTable() + "," + arrayOfString[2] + "," + arrayOfString[0];
                    hashMap.put("dict", str);
                    hashMap.put("pidField", arrayOfString[1]);
                    hashMap.put("hasChildField", arrayOfString[3]);
                    hashMap.put("pidValue", onlCgformField.getQueryDictField());
                } else {
                    hashMap.put("dictTable", onlCgformField.getQueryDictTable());
                    hashMap.put("dictCode", onlCgformField.getQueryDictField());
                    hashMap.put("dictText", onlCgformField.getQueryDictText());
                }
            } else {
                hashMap.put("view", onlCgformField.getFieldShowType());

                if ("cat_tree".equals(onlCgformField.getFieldShowType())) {
                    hashMap.put("pcode", onlCgformField.getDictField());

                } else if ("sel_tree".equals(onlCgformField.getFieldShowType())) {

                    String[] arrayOfString = onlCgformField.getDictText().split(",");
                    String str = onlCgformField.getDictTable() + "," + arrayOfString[2] + "," + arrayOfString[0];
                    hashMap.put("dict", str);
                    hashMap.put("pidField", arrayOfString[1]);
                    hashMap.put("hasChildField", arrayOfString[3]);
                    hashMap.put("pidValue", onlCgformField.getDictField());
                } else if ("popup".equals(onlCgformField.getFieldShowType())) {
                    hashMap.put("dictTable", onlCgformField.getDictTable());
                    hashMap.put("dictCode", onlCgformField.getDictField());
                    hashMap.put("dictText", onlCgformField.getDictText());
                }
                hashMap.put("mode", onlCgformField.getQueryMode());
            }
            if (++b1 > 2) {
                hashMap.put("hidden", "1");
            }
            arrayList.add(hashMap);
        }
        return arrayList;
    }


    @Override
    public List<OnlCgformField> queryFormFields(String code, boolean isform) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, code);
        if (isform) {
            lambdaQueryWrapper.eq(OnlCgformField::getIsShowForm, Integer.valueOf(1));
        }
        return list(lambdaQueryWrapper);
    }


    @Override
    public List<OnlCgformField> queryFormFieldsByTableName(String tableName) {
        OnlCgformHead onlCgformHead = (OnlCgformHead) this.cgformHeadMapper.selectOne((Wrapper) (new LambdaQueryWrapper<OnlCgformHead>()).eq(OnlCgformHead::getTableName, tableName));
        if (onlCgformHead != null) {
            LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper();
            lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId());
            return list(lambdaQueryWrapper);
        }
        return null;
    }


    @Override
    public OnlCgformField queryFormFieldByTableNameAndField(String tableName, String fieldName) {
        OnlCgformHead onlCgformHead = (OnlCgformHead) this.cgformHeadMapper.selectOne((Wrapper) (new LambdaQueryWrapper<OnlCgformHead>()).eq(OnlCgformHead::getTableName, tableName));
        if (onlCgformHead != null) {
            LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
            lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, onlCgformHead.getId());
            lambdaQueryWrapper.eq(OnlCgformField::getDbFieldName, fieldName);
            if (list(lambdaQueryWrapper) != null && list(lambdaQueryWrapper).size() > 0) {
                return (OnlCgformField) list(lambdaQueryWrapper).get(0);
            }
        }
        return null;
    }


    @Override
    public Map<String, Object> queryFormData(List<OnlCgformField> fieldList, String tbname, String id) {
        String str = b.a(tbname, fieldList, id);
        return this.onlCgformFieldMapper.queryFormData(str);
    }


    @Override
    public List<Map<String, Object>> querySubFormData(List<OnlCgformField> fieldList, String tbname, String linkField, String value) {
        String str = b.a(tbname, fieldList, linkField, value);
        return this.onlCgformFieldMapper.queryListData(str);
    }


    @Override
    public IPage<Map<String, Object>> selectPageBySql(Page<Map<String, Object>> page, String sql) {
        return ((OnlCgformFieldMapper) this.baseMapper).selectPageBySql(page, sql);
    }


    @Override
    public List<String> selectOnlineHideColumns(String tbname) {
        String str1 = "online:" + tbname + "%";
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String str2 = loginUser.getId();
        List list = ((OnlCgformFieldMapper) this.baseMapper).selectOnlineHideColumns(str2, str1);
        return a(list);
    }


    @Override
    public List<OnlCgformField> queryAvailableFields(String cgFormId, String tbname, String taskId, boolean isList) {
        LambdaQueryWrapper<OnlCgformField> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(OnlCgformField::getCgformHeadId, cgFormId);
        if (isList) {
            lambdaQueryWrapper.eq(OnlCgformField::getIsShowList, Integer.valueOf(1));
        } else {
            lambdaQueryWrapper.eq(OnlCgformField::getIsShowForm, Integer.valueOf(1));
        }
        lambdaQueryWrapper.orderByAsc(OnlCgformField::getOrderNum);
        List list = list(lambdaQueryWrapper);


        String str1 = "online:" + tbname + "%";
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String str2 = loginUser.getId();
        ArrayList arrayList1 = new ArrayList();
        if (oConvertUtils.isEmpty(taskId)) {
            List list1 = ((OnlCgformFieldMapper) this.baseMapper).selectOnlineHideColumns(str2, str1);
            if (list1 != null && list1.size() != 0 && list1.get(0) != null) {
                arrayList1.addAll(list1);

            }
        } else if (oConvertUtils.isNotEmpty(taskId)) {
            List list1 = ((OnlCgformFieldMapper) this.baseMapper).selectFlowAuthColumns(tbname, taskId, "1");
            if (list1 != null && list1.size() > 0 && list1.get(0) != null) {
                arrayList1.addAll(list1);
            }
        }


        if (arrayList1.size() == 0) {
            return list;
        }


        ArrayList arrayList2 = new ArrayList();

        for (byte b1 = 0; b1 < list.size(); b1++) {
            OnlCgformField onlCgformField = (OnlCgformField) list.get(b1);
            if (b(onlCgformField.getDbFieldName(), arrayList1)) {
                arrayList2.add(onlCgformField);
            }
        }
        return arrayList2;
    }


    @Override
    public List<String> queryDisabledFields(String tbname) {
        String str1 = "online:" + tbname + "%";
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String str2 = loginUser.getId();
        List list = ((OnlCgformFieldMapper) this.baseMapper).selectOnlineDisabledColumns(str2, str1);
        return a(list);
    }


    @Override
    public List<String> queryDisabledFields(String tbname, String taskId) {
        if (oConvertUtils.isEmpty(taskId)) {
            return null;
        }
        List list = ((OnlCgformFieldMapper) this.baseMapper).selectFlowAuthColumns(tbname, taskId, "2");
        return a(list);
    }


    private List<String> a(List<String> paramList) {
        ArrayList arrayList = new ArrayList();
        if (paramList == null || paramList.size() == 0 || paramList.get(0) == null) {
            return arrayList;
        }
        for (String str1 : paramList) {
            if (oConvertUtils.isEmpty(str1)) {
                continue;
            }
            String str2 = str1.substring(str1.lastIndexOf(":") + 1);
            if (oConvertUtils.isEmpty(str2)) {
                continue;
            }
            arrayList.add(str2);
        }
        return arrayList;
    }


    @Override
    public List<OnlCgformField> queryAvailableFields(String tbname, boolean isList, List<OnlCgformField> List, List<String> needList) {
        ArrayList arrayList = new ArrayList();

        String str1 = "online:" + tbname + "%";
        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        String str2 = loginUser.getId();
        List list = ((OnlCgformFieldMapper) this.baseMapper).selectOnlineHideColumns(str2, str1);


        boolean bool = true;
        if (list == null || list.size() == 0 || list.get(0) == null) {
            bool = false;
        }

        for (OnlCgformField onlCgformField : List) {
            String str = onlCgformField.getDbFieldName();
            if (needList != null && needList.contains(str)) {
                onlCgformField.setIsQuery(Integer.valueOf(1));
                arrayList.add(onlCgformField);

                continue;
            }

            if (isList) {

                if (onlCgformField.getIsShowList().intValue() != 1) {
                    if (oConvertUtils.isNotEmpty(onlCgformField.getMainTable()) && oConvertUtils.isNotEmpty(onlCgformField.getMainField())) {
                        arrayList.add(onlCgformField);
                    }


                    continue;
                }
            } else if (onlCgformField.getIsShowForm().intValue() != 1) {
                continue;
            }


            if (bool) {
                if (b(str, list))
                    arrayList.add(onlCgformField);
                continue;
            }
            arrayList.add(onlCgformField);
        }


        return arrayList;
    }


    private boolean b(String paramString, List<String> paramList) {
        boolean bool = true;
        for (byte b1 = 0; b1 < paramList.size(); b1++) {
            String str = (String) paramList.get(b1);
            if (!oConvertUtils.isEmpty(str)) {


                String str1 = str.substring(str.lastIndexOf(":") + 1);
                if (!oConvertUtils.isEmpty(str1)) {

                    if (str1.equals(paramString)) {
                        bool = false;
                    }
                }
            }
        }
        return bool;
    }


    public boolean a(String paramString, List<OnlCgformField> paramList) {
        boolean bool = false;
        for (OnlCgformField onlCgformField : paramList) {
            if (oConvertUtils.camelToUnderline(paramString).equals(onlCgformField.getDbFieldName())) {
                bool = true;
                break;
            }
        }
        return bool;
    }


    @Override
    public void executeInsertSQL(Map<String, Object> params) {
        ((OnlCgformFieldMapper) this.baseMapper).executeInsertSQL(params);
    }


    @Override
    public void executeUpdatetSQL(Map<String, Object> params) {
        ((OnlCgformFieldMapper) this.baseMapper).executeUpdatetSQL(params);
    }


    @Override
    public List<TreeModel> queryDataListByLinkDown(LinkDown linkDown) {
        return ((OnlCgformFieldMapper) this.baseMapper).queryDataListByLinkDown(linkDown);
    }


    @Override
    public void updateTreeNodeNoChild(String tableName, String filed, String id) {
        Map map = b.a(tableName, filed, id);
        ((OnlCgformFieldMapper) this.baseMapper).executeUpdatetSQL(map);
    }
}
